#ifndef __GP_SP140A_CALIBRATION_H__
#define __GP_SP140A_CALIBRATION_H__

#include "..\gp_LensDef.h"

static const short	g_ob[15] =
{
	0,			// obautoen
	0,			// ob_type
	0,			// obHOffset
	0,			// obVOffset
	
	1,			// obmanuen
	8,			// maunob
	
	1,			// wboffseten
	0,			// wbo_r
	0,			// wbo_gr
	0,			// wbo_gb
	0,			// wbo_b
	
	0,			// badpixen
	160,		// bprthr
	160,		// bpgthr
	160,		// bpbthr
};

static const unsigned int	g_gamma[] =
{

// 1248 with H22
0x04510d, 0x051112, 0x111417, 0x14451b, 0x111120, 0x044425, 0x111129, 0x05112d,
0x044432, 0x044436, 0x04443a, 0x04443e, 0x044442, 0x110446, 0x111149, 0x04444d,
0x111051, 0x044154, 0x111058, 0x10445b, 0x04415e, 0x011062, 0x011065, 0x010468,
0x01046b, 0x01046e, 0x041071, 0x041074, 0x104176, 0x010479, 0x04107c, 0x00417e,
0x041081, 0x010183, 0x101086, 0x040488, 0x01018a, 0x10408d, 0x10108f, 0x041091,
0x040493, 0x040495, 0x040497, 0x040499, 0x10109b, 0x00109d, 0x00409f, 0x0101a0,
0x1004a2, 0x0010a4, 0x0100a6, 0x1004a7, 0x0040a9, 0x1001aa, 0x0040ac, 0x1001ad,
0x0100af, 0x0004b0, 0x0400b2, 0x0040b3, 0x0004b4, 0x0400b6, 0x0100b7, 0x0010b8,
0x0004b9, 0x1000bb, 0x0400bc, 0x0100bd, 0x0040be, 0x0010bf, 0x0004c0, 0x0004c1,
0x0001c2, 0x0001c3, 0x0000c5, 0x0000c6, 0x0000c7, 0x0000c8, 0x0000c9, 0x0000ca,
0x0000cb, 0x0000cc, 0x0000cd, 0x0000ce, 0x0000cf, 0x0000d0, 0x0001d0, 0x0001d1,
0x0001d2, 0x0001d3, 0x0001d4, 0x0001d5, 0x0001d6, 0x0001d7, 0x0001d8, 0x0001d9,
0x0000db, 0x0000dc, 0x1000dd, 0x0400de, 0x0400df, 0x0100e0, 0x0040e1, 0x0010e2,
0x0004e3, 0x1000e5, 0x0100e6, 0x0040e7, 0x0004e8, 0x1000ea, 0x0100eb, 0x0004ec,
0x0400ee, 0x0040ef, 0x1001f0, 0x0040f2, 0x1004f3, 0x0040f5, 0x0401f6, 0x0010f8,
0x0100fa, 0x0404fb, 0x1010fd, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff
/*
//0.35
0x11440e, 0x045112, 0x111417, 0x04511b, 0x144420, 0x111124, 0x111128, 0x05112c, 
0x044431, 0x110435, 0x111138, 0x11113c, 0x044140, 0x104444, 0x011147, 0x04444b, 
0x01114e, 0x110452, 0x044155, 0x041158, 0x01105c, 0x01105f, 0x010462, 0x010465, 
0x011068, 0x04106b, 0x10416d, 0x104170, 0x010473, 0x104076, 0x010478, 0x10107b, 
0x01047d, 0x104080, 0x041082, 0x010484, 0x004186, 0x101089, 0x10108b, 0x04108d, 
0x04048f, 0x040491, 0x040493, 0x101095, 0x101097, 0x004099, 0x01009b, 0x04019c, 
0x10109e, 0x0040a0, 0x0401a1, 0x0010a3, 0x0100a5, 0x1004a6, 0x0100a8, 0x0004a9, 
0x0100ab, 0x0010ac, 0x0400ae, 0x0040af, 0x0004b0, 0x0400b2, 0x0040b3, 0x0010b4, 
0x1001b5, 0x0400b7, 0x0100b8, 0x0010b9, 0x0004ba, 0x0001bb, 0x1000bd, 0x0400be, 
0x0100bf, 0x0100c0, 0x0040c1, 0x0010c2, 0x0010c3, 0x0004c4, 0x0004c5, 0x0004c6, 
0x0001c7, 0x0001c8, 0x0001c9, 0x0000cb, 0x0000cc, 0x0000cd, 0x1000ce, 0x1000cf, 
0x1000d0, 0x1000d1, 0x0400d2, 0x0400d3, 0x0100d4, 0x0100d5, 0x0040d6, 0x0040d7, 
0x0010d8, 0x0004d9, 0x0001da, 0x1000dc, 0x0400dd, 0x0100de, 0x0040df, 0x0004e0, 
0x1001e1, 0x0400e3, 0x0040e4, 0x0004e5, 0x1000e7, 0x0040e8, 0x0004e9, 0x0400eb, 
0x0040ec, 0x1001ed, 0x0040ef, 0x1001f0, 0x0040f2, 0x0401f3, 0x0010f5, 0x0100f7, 
0x0401f8, 0x0010fa, 0x0040fc, 0x0101fd, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff

//0.40
0x111106, 0x11440b, 0x04510f, 0x111414, 0x051118, 0x04441d, 0x111121, 0x111125, 
0x111129, 0x11112d, 0x111131, 0x111135, 0x041139, 0x04443d, 0x111041, 0x044144, 
0x110448, 0x04414b, 0x01114e, 0x110452, 0x104455, 0x044158, 0x04115b, 0x04115e, 
0x044161, 0x104164, 0x104167, 0x01046a, 0x04106d, 0x10416f, 0x010472, 0x101075, 
0x010477, 0x10407a, 0x04047c, 0x01017e, 0x104081, 0x041083, 0x040485, 0x010487, 
0x010189, 0x01018b, 0x01018d, 0x01018f, 0x040191, 0x040493, 0x100495, 0x001097, 
0x004099, 0x04019a, 0x10109c, 0x00409e, 0x04019f, 0x0010a1, 0x0400a3, 0x0010a4, 
0x0400a6, 0x0010a7, 0x0401a8, 0x0040aa, 0x0004ab, 0x0400ad, 0x0040ae, 0x0004af, 
0x0400b1, 0x0040b2, 0x0010b3, 0x0001b4, 0x0400b6, 0x0100b7, 0x0040b8, 0x0004b9, 
0x0001ba, 0x1000bc, 0x0400bd, 0x0100be, 0x0040bf, 0x0010c0, 0x0010c1, 0x0004c2, 
0x0001c3, 0x0000c5, 0x1000c6, 0x0400c7, 0x0100c8, 0x0100c9, 0x0040ca, 0x0010cb, 
0x0004cc, 0x0004cd, 0x0001ce, 0x1000d0, 0x0400d1, 0x0100d2, 0x0040d3, 0x0004d4, 
0x0001d5, 0x0400d7, 0x0100d8, 0x0010d9, 0x0004da, 0x0400dc, 0x0100dd, 0x0010de, 
0x1001df, 0x0040e1, 0x0004e2, 0x0400e4, 0x0010e5, 0x0401e6, 0x0010e8, 0x0401e9, 
0x0010eb, 0x0100ed, 0x1004ee, 0x0040f0, 0x0101f1, 0x1004f3, 0x0010f5, 0x0040f7, 
0x0101f8, 0x0101fa, 0x0404fc, 0x0004fe, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff
*/
/*
//0.45
0x11110c, 0x111110, 0x011114, 0x044418, 0x04441c, 0x110420, 0x111123, 0x044427, 
0x11102b, 0x04412e, 0x111032, 0x104435, 0x041138, 0x01103c, 0x11043f, 0x104442, 
0x104145, 0x044148, 0x10414b, 0x10414e, 0x104451, 0x010454, 0x011057, 0x04105a, 
0x10415c, 0x01045f, 0x101062, 0x010464, 0x101067, 0x010469, 0x10406c, 0x04046e, 
0x010170, 0x104073, 0x041075, 0x040477, 0x010179, 0x01017b, 0x00417d, 0x004080, 
0x004082, 0x004084, 0x004086, 0x010187, 0x010189, 0x04048b, 0x10048d, 0x00108f, 
0x004091, 0x040192, 0x100494, 0x004096, 0x040197, 0x100499, 0x00409b, 0x10049c, 
0x00409e, 0x04019f, 0x0040a1, 0x0401a2, 0x0040a4, 0x1001a5, 0x0100a7, 0x0004a8, 
0x0400aa, 0x0010ab, 0x1001ac, 0x0100ae, 0x0010af, 0x1001b0, 0x0100b2, 0x0010b3, 
0x0004b4, 0x0400b6, 0x0040b7, 0x0010b8, 0x1001b9, 0x0400bb, 0x0040bc, 0x0010bd, 
0x0001be, 0x0400c0, 0x0100c1, 0x0010c2, 0x0001c3, 0x0400c5, 0x0100c6, 0x0010c7, 
0x0004c8, 0x1000ca, 0x0100cb, 0x0040cc, 0x0004cd, 0x1000cf, 0x0100d0, 0x0010d1, 
0x0001d2, 0x0400d4, 0x0040d5, 0x0004d6, 0x0400d8, 0x0040d9, 0x0004da, 0x0400dc, 
0x0010dd, 0x1001de, 0x0040e0, 0x1004e1, 0x0100e3, 0x0004e4, 0x0100e6, 0x1004e7, 
0x0100e9, 0x1004ea, 0x0040ec, 0x0401ed, 0x0010ef, 0x0040f1, 0x0401f2, 0x1004f4, 
0x0040f6, 0x0100f8, 0x0401f9, 0x0404fb, 0x1010fd, 0x0000ff, 0x0000ff, 0x0000ff*/

};

static const unsigned int g_gamma2[] =
{
// 1248 with H22
0x04510d, 0x051112, 0x111417, 0x14451b, 0x111120, 0x044425, 0x111129, 0x05112d,
0x044432, 0x044436, 0x04443a, 0x04443e, 0x044442, 0x110446, 0x111149, 0x04444d,
0x111051, 0x044154, 0x111058, 0x10445b, 0x04415e, 0x011062, 0x011065, 0x010468,
0x01046b, 0x01046e, 0x041071, 0x041074, 0x104176, 0x010479, 0x04107c, 0x00417e,
0x041081, 0x010183, 0x101086, 0x040488, 0x01018a, 0x10408d, 0x10108f, 0x041091,
0x040493, 0x040495, 0x040497, 0x040499, 0x10109b, 0x00109d, 0x00409f, 0x0101a0,
0x1004a2, 0x0010a4, 0x0100a6, 0x1004a7, 0x0040a9, 0x1001aa, 0x0040ac, 0x1001ad,
0x0100af, 0x0004b0, 0x0400b2, 0x0040b3, 0x0004b4, 0x0400b6, 0x0100b7, 0x0010b8,
0x0004b9, 0x1000bb, 0x0400bc, 0x0100bd, 0x0040be, 0x0010bf, 0x0004c0, 0x0004c1,
0x0001c2, 0x0001c3, 0x0000c5, 0x0000c6, 0x0000c7, 0x0000c8, 0x0000c9, 0x0000ca,
0x0000cb, 0x0000cc, 0x0000cd, 0x0000ce, 0x0000cf, 0x0000d0, 0x0001d0, 0x0001d1,
0x0001d2, 0x0001d3, 0x0001d4, 0x0001d5, 0x0001d6, 0x0001d7, 0x0001d8, 0x0001d9,
0x0000db, 0x0000dc, 0x1000dd, 0x0400de, 0x0400df, 0x0100e0, 0x0040e1, 0x0010e2,
0x0004e3, 0x1000e5, 0x0100e6, 0x0040e7, 0x0004e8, 0x1000ea, 0x0100eb, 0x0004ec,
0x0400ee, 0x0040ef, 0x1001f0, 0x0040f2, 0x1004f3, 0x0040f5, 0x0401f6, 0x0010f8,
0x0100fa, 0x0404fb, 0x1010fd, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff, 0x0000ff
};

static const unsigned short g_wb_gain[71][2] =
{				/*2000K~8000K*/

	{50 ,168},
	{52 ,166},
	{54 ,164},
	{56 ,162},
	{58 ,160},
	{60 ,158},
	{62 ,156},
	{64 ,154},
	{66 ,152},
	{68 ,150},
	{69 ,148},
	{71 ,146},
	{73 ,144},
	{74 ,142},
	{76 ,140},
	{78 ,138},
	{79 ,136},
	{81 ,134},
	{82 ,131},
	{83 ,129},
	{85 ,127},
	{86 ,125},//40
	{88 ,123},
	{89 ,121},
	{90 ,119},
	{92 ,117},
	{93 ,115},
	{94 ,113},
	{95 ,111},
	{97 ,109},
	{98 ,107},
	{99 ,105},//50
	{100,103},
	{102,101},
	{103,99 },
	{104,98 },
	{105,96 },
	{106,94 },
	{108,92 },
	{109,91 },
	{110,89 },
	{111,87 },//60
	{113,86 },
	{114,84 },
	{115,83 },
	{117,81 },
	{118,80 },
	{119,79 },
	{121,77 },
	{122,76 },
	{123,75 },
	{125,74 },//70
	{126,73 },
	{128,72 },
	{129,71 },
	{131,70 },
	{132,69 },
	{134,68 },
	{136,68 },
	{137,67 },
	{139,67 },//80   
	{141,66 },
	{143,66 },
	{145,65 },
	{147,65 },
	{149,65 },
	{151,65 },
	{153,65 },
	{155,65 },
	{157,64 },
	{159,64 }
	
};

static const short	g_awb_thr[] =
{
	200,		// awbwinthr
	0 * 64,		// sindata
	1 * 64,		// cosdata
	40,			// Ythr0
	95,			// Ythr1
	150,		// Ythr2
	200,		// Ythr3

	// wb thr
	-3,			//UL1N1
	3,			//UL1P1
	-3,			//VL1N1
	3,			//VL1P1
	-6,			//UL1N2
	6,			//UL1P2
	-6,			//VL1N2
	6,			//VL1P2
	-10,			//UL1N3
	10,			//UL1P3
	-10,			//VL1N3
	10,			//VL1P3

	// without wb thr
	-15,		// UL1N1
	-6,			// UL1P1
	-13,		// VL1N1
	2,			// VL1P1
	-34,		//UL1N2
	-19,			//UL1P2
	-26,		//VL1N2
	2,			// VL1P2
	-54,		// UL1N3
	-32,			//UL1P3
	-41,		// VL1N3
	3,			//VL1P3
	
	
	
	//initial r/b gain
	107, //r gain
	103,  //b gain 	

	//GdivB& GdivR
	0,			//awb_win.gdbthr1
	16383,	//awb_win.gdbthr2
	0,			//awb_win.gdrthr1
	16383	//awb_win.gdrthr2
};


static const short	g_color_matrix[9] =
{
(short) (1.45277916223902070492  * 64),
(short) (-0.37128585316919238135 * 64),
(short) (-0.08149330906982832357 * 64),
(short) (-0.41226642794909856837 * 64),
(short) (1.77049387084235210210  * 64),
(short) (-0.35822744289325381128 * 64),
(short) (-0.05892337587965290613 * 64),
(short) (-0.93877812076626143689 * 64),
(short) (1.99770149664591434302  * 64)
		
};

const INT8U LiTable_rgb[48] =
{
	0x1e, 0x2e, 0x3e, 0x4e, 0x5e, 0x6e, 0x7e, 0x8e, 0x9e, 0xae, 0xbe, 0xce,
	0xde, 0xee, 0xfe, 0xff, 0x0f, 0x1f, 0x2f, 0x3f, 0x4f, 0x5f, 0x6f, 0x7f,
	0x8f, 0x9f, 0xaf, 0xbf, 0xcf, 0xdf, 0xef, 0xff, 0x07, 0x17, 0x27, 0x37, 
	0x47, 0x57, 0x67, 0x77, 0x87, 0x97, 0xa7, 0xb7, 0xc7, 0xd7, 0xe7, 0xf7
};

const INT16U MaxTan8[32] =
{
	0x0C0, 0x155, 0x154, 0x0C1, 0x0BF, 0x156, 0x153, 0x0C2, 0x0BF, 0x154, 0x153, 
	0x0C0, 0x0BE, 0x155, 0x152, 0x0C1, 0x0BE, 0x153, 0x152, 0x0BF, 0x0BD, 0x154, 
	0x151, 0x0C0, 0x0BD, 0x152, 0x151, 0x0BE, 0x0BC, 0x153, 0x150, 0x0BF
};

const INT16U Slope4[16] =
{ 
	0x155, 0x154, 0x153, 0x152, 0x151, 0x152, 0x153, 0x154,
	0x155, 0x154, 0x153, 0x152, 0x151, 0x152, 0x153, 0x154 
};

const INT16U CLPoint[8] =	
{
	0x400, 0x300, 0x400, 0x300, 0x400, 0x300, 0x400, 0x300
};

const INT16U Radius_File_0[512] =
{
	0x100, 0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x102, 0x103, 0x104, 
	0x105, 0x106, 0x107, 0x108, 0x109, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 
	0x10a, 0x10b, 0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x108, 
	0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x10a, 0x10b, 0x10c, 0x10d, 
	0x10e, 0x10f, 0x110, 0x111, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 
	0x113, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x110, 0x111, 
	0x112, 0x113, 0x114, 0x115, 0x116, 0x117, 0x112, 0x113, 0x114, 0x115, 0x116, 
	0x117, 0x118, 0x119, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 
	0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x118, 0x119, 0x11a, 
	0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 
	0x120, 0x121, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x11e, 
	0x11f, 0x120, 0x121, 0x122, 0x123, 0x124, 0x125, 0x102, 0x103, 0x104, 0x105, 
	0x106, 0x107, 0x108, 0x109, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10a, 
	0x10b, 0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x108, 0x109, 
	0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 
	0x10f, 0x110, 0x111, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 
	0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x110, 0x111, 0x112, 
	0x113, 0x114, 0x115, 0x116, 0x117, 0x112, 0x113, 0x114, 0x115, 0x116, 0x117, 
	0x118, 0x119, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x116, 
	0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x118, 0x119, 0x11a, 0x11b, 
	0x11c, 0x11d, 0x11e, 0x11f, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 
	0x121, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x11e, 0x11f, 
	0x120, 0x121, 0x122, 0x123, 0x124, 0x125, 0x120, 0x121, 0x122, 0x123, 0x124, 
	0x125, 0x126, 0x127, 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 
	0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x108, 0x109, 0x10a, 
	0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 
	0x110, 0x111, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x10e, 
	0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x110, 0x111, 0x112, 0x113, 
	0x114, 0x115, 0x116, 0x117, 0x112, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 
	0x119, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x116, 0x117, 
	0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 
	0x11d, 0x11e, 0x11f, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 
	0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x11e, 0x11f, 0x120, 
	0x121, 0x122, 0x123, 0x124, 0x125, 0x120, 0x121, 0x122, 0x123, 0x124, 0x125, 
	0x126, 0x127, 0x122, 0x123, 0x124, 0x125, 0x126, 0x127, 0x128, 0x129, 0x106, 
	0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x108, 0x109, 0x10a, 0x10b, 
	0x10c, 0x10d, 0x10e, 0x10f, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 
	0x111, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x10e, 0x10f, 
	0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x110, 0x111, 0x112, 0x113, 0x114, 
	0x115, 0x116, 0x117, 0x112, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 
	0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x116, 0x117, 0x118, 
	0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 
	0x11e, 0x11f, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x11c, 
	0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x11e, 0x11f, 0x120, 0x121, 
	0x122, 0x123, 0x124, 0x125, 0x120, 0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 
	0x127, 0x122, 0x123, 0x124, 0x125, 0x126, 0x127, 0x128, 0x129, 0x124, 0x125, 
	0x126, 0x127, 0x128, 0x129, 0x12a, 0x12b
};

const INT16U Radius_File_1[512] =
{
	0x101, 0x102, 0x103, 0x104, 0x105, 0x106, 0x107, 0x108, 0x103, 0x104, 0x105, 
	0x106, 0x107, 0x108, 0x109, 0x10a, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10a, 
	0x10b, 0x10c, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x109, 
	0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x10b, 0x10c, 0x10d, 0x10e, 
	0x10f, 0x110, 0x111, 0x112, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 
	0x114, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x111, 0x112, 
	0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x113, 0x114, 0x115, 0x116, 0x117, 
	0x118, 0x119, 0x11a, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 
	0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x119, 0x11a, 0x11b, 
	0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 
	0x121, 0x122, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x124, 0x11f, 
	0x120, 0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 0x103, 0x104, 0x105, 0x106, 
	0x107, 0x108, 0x109, 0x10a, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 
	0x10c, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x109, 0x10a, 
	0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 
	0x110, 0x111, 0x112, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 
	0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x111, 0x112, 0x113, 
	0x114, 0x115, 0x116, 0x117, 0x118, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 
	0x119, 0x11a, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x117, 
	0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x119, 0x11a, 0x11b, 0x11c, 
	0x11d, 0x11e, 0x11f, 0x120, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 
	0x122, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x124, 0x11f, 0x120, 
	0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 0x121, 0x122, 0x123, 0x124, 0x125, 
	0x126, 0x127, 0x128, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 
	0x107, 0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x109, 0x10a, 0x10b, 
	0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 
	0x111, 0x112, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x10f, 
	0x110, 0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x111, 0x112, 0x113, 0x114, 
	0x115, 0x116, 0x117, 0x118, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 
	0x11a, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x117, 0x118, 
	0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 
	0x11e, 0x11f, 0x120, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 
	0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x124, 0x11f, 0x120, 0x121, 
	0x122, 0x123, 0x124, 0x125, 0x126, 0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 
	0x127, 0x128, 0x123, 0x124, 0x125, 0x126, 0x127, 0x128, 0x129, 0x12a, 0x107, 
	0x108, 0x109, 0x10a, 0x10b, 0x10c, 0x10d, 0x10e, 0x109, 0x10a, 0x10b, 0x10c, 
	0x10d, 0x10e, 0x10f, 0x110, 0x10b, 0x10c, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 
	0x112, 0x10d, 0x10e, 0x10f, 0x110, 0x111, 0x112, 0x113, 0x114, 0x10f, 0x110, 
	0x111, 0x112, 0x113, 0x114, 0x115, 0x116, 0x111, 0x112, 0x113, 0x114, 0x115, 
	0x116, 0x117, 0x118, 0x113, 0x114, 0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 
	0x115, 0x116, 0x117, 0x118, 0x119, 0x11a, 0x11b, 0x11c, 0x117, 0x118, 0x119, 
	0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 0x119, 0x11a, 0x11b, 0x11c, 0x11d, 0x11e, 
	0x11f, 0x120, 0x11b, 0x11c, 0x11d, 0x11e, 0x11f, 0x120, 0x121, 0x122, 0x11d, 
	0x11e, 0x11f, 0x120, 0x121, 0x122, 0x123, 0x124, 0x11f, 0x120, 0x121, 0x122, 
	0x123, 0x124, 0x125, 0x126, 0x121, 0x122, 0x123, 0x124, 0x125, 0x126, 0x127, 
	0x128, 0x123, 0x124, 0x125, 0x126, 0x127, 0x128, 0x129, 0x12a, 0x125, 0x126, 
	0x127, 0x128, 0x129, 0x12a, 0x12b, 0x12c
};

INT16S g_awb_new_thr[13*5] = 
{ 
// global
20, //40,
180,//150,
 123,
 193,
 -23,
 88,
 63,
 136,
 48,
 89,
 30,
 60,
 2,// 2,

	
// 2800
 40,
190,//150,
 168,
 177,
 70,
 79,
 121,
 126,
46,
 50,
44,
49,
3,//2,

 
// 4000
 40,
190,//150,
 144,
151,
27,
 32,
 87,
 91,
 56,
59,
38,
43,
 2,
 
 
// 5000
 40,
190,//150,
147,
154,
 5,
11,
 77,
 81,
69,
 72,
42,
46,
2,//1,
 
// 6500
40,
190,//150,
150,
156,
-15,
 -7,
 69,
73,
80,
83,
43,
48,
2,//1,

};

const ALIGN4 INT32U g_Y_lut[64] =
{
/*
 0x02010100, 0x04040302, 0x07060505, 0x09090807, 0x0c0b0b0a, 0x0f0e0d0d, 0x12111010, 0x15151413,
 0x19181716, 0x1d1c1b1a, 0x21201f1e, 0x26252422, 0x2b2a2827, 0x302f2e2c, 0x36343332, 0x3b3a3837,
 0x41403e3d, 0x47464443, 0x4d4c4a49, 0x5352504f, 0x5a585655, 0x605e5d5b, 0x66656361, 0x6c6b6968,
 0x7371706e, 0x79777674, 0x7f7d7c7a, 0x85838280, 0x8b898886, 0x908f8d8c, 0x96949392, 0x9b999897,
 0xa09e9d9c, 0xa5a3a2a1, 0xa9a8a7a6, 0xaeadabaa, 0xb2b1b0af, 0xb6b5b4b3, 0xbab9b8b7, 0xbebdbcbb,
 0xc2c1c0bf, 0xc5c4c4c3, 0xc9c8c7c6, 0xcccbcbca, 0xcfcfcecd, 0xd3d2d1d0, 0xd6d5d4d3, 0xd9d8d7d6,
 0xdbdbdad9, 0xdedddddc, 0xe1e0e0df, 0xe3e3e2e1, 0xe6e5e5e4, 0xe8e8e7e7, 0xebeaeae9, 0xededeceb,
 0xf0efeeee, 0xf2f1f1f0, 0xf4f4f3f2, 0xf6f6f5f5, 0xf8f8f7f7, 0xfbfafaf9, 0xfdfcfcfb, 0xfffefefd,
 */
 0x03020100, 0x06050403, 0x09080707, 0x0d0c0b0a, 0x100f0e0e, 0x13121211, 0x17161514, 0x1a191817,
 0x1e1d1c1b, 0x21201f1e, 0x24232222, 0x28272625, 0x2b2a2929, 0x2f2e2d2c, 0x32313030, 0x36353433,
 0x3a393837, 0x3d3c3b3a, 0x41403f3e, 0x45444342, 0x48484746, 0x4c4b4b4a, 0x504f4e4d, 0x54535251,
 0x58575655, 0x5c5b5a59, 0x605f5e5d, 0x63626261, 0x67666564, 0x6b6a6968, 0x6f6e6d6c, 0x73727170,
 0x77767574, 0x7b7a7978, 0x7f7e7d7c, 0x83828180, 0x87868584, 0x8b8a8988, 0x8f8e8d8c, 0x93929190,
 0x98969594, 0x9c9b9a99, 0xa09f9e9d, 0xa4a3a2a1, 0xa8a7a6a5, 0xadacaba9, 0xb1b0afae, 0xb6b4b3b2,
 0xbab9b8b7, 0xbebdbcbb, 0xc3c2c0bf, 0xc8c6c5c4, 0xcccbcac9, 0xd1cfcecd, 0xd5d4d3d2, 0xdad9d7d6,
 0xdedddcdb, 0xe3e2e1df, 0xe8e6e5e4, 0xecebeae9, 0xf1f0efee, 0xf5f4f3f2, 0xfaf9f8f7, 0xfffefdfc,
};


const ALIGN4 INT32U g_Y_lut2[64] =
{
 0x02010100, 0x04030302, 0x07060605, 0x09080807, 0x0c0b0a0a, 0x0f0e0d0d, 0x1110100f, 0x14131312,
 0x18171615, 0x1a191918, 0x1d1d1c1b, 0x201f1f1e, 0x24232221, 0x27272625, 0x2b2a2928, 0x2f2e2d2c,
 0x33323130, 0x37363534, 0x3b3a3938, 0x403f3d3c, 0x44434241, 0x49474645, 0x4e4c4b4a, 0x5351504f,
 0x57565554, 0x5c5b5a58, 0x61605e5d, 0x66646362, 0x6b6a6867, 0x6f6e6d6c, 0x74737271, 0x78777675,
 0x7e7c7b7a, 0x8281807f, 0x87858483, 0x8b8a8988, 0x908f8e8c, 0x94939291, 0x98979695, 0x9d9b9a99,
 0xa1a09f9e, 0xa5a4a3a2, 0xa9a8a7a6, 0xadacabaa, 0xb2b0afae, 0xb5b4b3b3, 0xbab9b8b7, 0xbdbcbcbb,
 0xc1c0bfbe, 0xc6c5c4c2, 0xc9c8c7c7, 0xcdcccbca, 0xd1d0cfce, 0xd5d4d3d2, 0xd9d8d7d6, 0xdddcdbda,
 0xe1e0dfde, 0xe6e5e3e2, 0xeae9e8e7, 0xeeedeceb, 0xf2f1f0ef, 0xf6f5f4f3, 0xfbf9f8f7, 0xfffefdfc, 
};


const ALIGN4 INT32U g_Y_identity[64] =
{
 0x03020100, 0x07060504, 0x0b0a0908, 0x0f0e0d0c, 0x13121110, 0x17161514, 0x1b1a1918, 0x1f1e1d1c, 
 0x23222120, 0x27262524, 0x2b2a2928, 0x2f2e2d2c, 0x33323130, 0x37363534, 0x3b3a3938, 0x3f3e3d3c, 
 0x43424140, 0x47464544, 0x4b4a4948, 0x4f4e4d4c, 0x53525150, 0x57565554, 0x5b5a5958, 0x5f5e5d5c, 
 0x63626160, 0x67666564, 0x6b6a6968, 0x6f6e6d6c, 0x73727170, 0x77767574, 0x7b7a7978, 0x7f7e7d7c, 
 0x83828180, 0x87868584, 0x8b8a8988, 0x8f8e8d8c, 0x93929190, 0x97969594, 0x9b9a9998, 0x9f9e9d9c, 
 0xa3a2a1a0, 0xa7a6a5a4, 0xabaaa9a8, 0xafaeadac, 0xb3b2b1b0, 0xb7b6b5b4, 0xbbbab9b8, 0xbfbebdbc, 
 0xc3c2c1c0, 0xc7c6c5c4, 0xcbcac9c8, 0xcfcecdcc, 0xd3d2d1d0, 0xd7d6d5d4, 0xdbdad9d8, 0xdfdedddc, 
 0xe3e2e1e0, 0xe7e6e5e4, 0xebeae9e8, 0xefeeedec, 0xf3f2f1f0, 0xf7f6f5f4, 0xfbfaf9f8, 0xfffefdfc, 
};


const ALIGN4 INT16U NRthr[6][7] = 
{
    {1, 2, 3, 1, 2, 3, 4},
    {1, 2, 3, 3, 6, 9, 12},
    {1, 2, 3, 4, 7, 10, 14},
    {1, 2, 3, 4, 8, 12, 16},
    {1, 2, 3, 4, 8, 16, 32},
    {1, 2, 3, 5, 10, 20, 32} 
};

const ALIGN4 INT16U DPCthr[6][4] = 
{
    {0, 20, 35, 4},
    {0, 22, 30, 4},
    {0, 24, 28, 4},
    {0, 26, 25, 4},
    {0, 28, 23, 4},
    {0, 30, 20, 4}

};

const gpCisCali_t g_cali =
{
	(INT16U *)g_ob,
	(INT16U *) Radius_File_0,
	(INT16U *) Radius_File_1,
	(INT16U *) CLPoint,
	(INT16U *) MaxTan8,
	(INT16U *) Slope4,
	20,			
	(INT32U *) g_gamma,
	(INT32U *) g_gamma2,
	(INT16S *) g_awb_thr,
	(INT16U(*)[2]) g_wb_gain,
	(INT16S *) g_color_matrix,
	(INT16S *) g_awb_new_thr,
	sizeof(g_awb_new_thr)/2/13,

	0,			/*Ae weight*/

	/*YUV Spec Constrat*/
	(INT32U *) g_Y_lut,
	(INT32U *) g_Y_lut2,
	
	(INT16U (*)[7]) NRthr,
	(INT16U (*)[4]) DPCthr,
};

#endif
